package com.itheima.a06args;

public class ArgsDemo3 {
    public static void main(String[] args) {

        System.out.println(getSum(1,2,3,4,5,6,7,8,9));
    }


    //参数列表，数据类型+...+数组名字
    public static int getSum(int ...args){
        int sum=0;
        for(int i:args){
            sum+=i;
        }
        return sum;
    }
}
